<?php
  class Plugins_Cuisinedata extends model {
  
  
  
  function getformadd($productid="")
  {
  
//$code  = '<div class="itPlg">'."\n";

//$code .= '</div>';
  
$code  = '<div class="wrpPlg clBg5 clBd2 bdFull">'."\n";
$code .= '<div class="wrpOutAtcPlg">'."\n";
$code .= '<div class="wrpAtcPlg">'."\n";
$code .= '<span class="ico icoCookPlg"></span>'."\n";
$code .= '<div class="spnAtcPlg clTxtW">'."\n";
$code .= '<span class="txtAtcPlg fs03">Cuisine Data</span>'."\n";
$code .= '</div>'."\n";
$code .= '</div>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="wrpTl">'."\n";
$code .= '<div title="Close" class="btnIco closeTl clBd3 mgBtm10 deleterowbutton">'."\n";
$code .= '<span class="ico icoCloseTl"></span>'."\n";
$code .= '</div>'."\n";
$code .= '</div>'."\n";
$code .= '<form class="frmFrmPlg clTxt3 fs03">'."\n";
$code .= '<fieldset class="wrpFrmPlg">'."\n";
$code .= '<table class="tbGenInfo tbAddCtnt clTxt3 fs03">'."\n";
$code .= '<tbody><tr>'."\n";
$code .= '<th>Prep Time</th>'."\n";
$code .= '<td>'."\n";
$code .= '<input type="text" name="preptime[]" placeholder="ex: 1 hour" class="clBg5 clBd2 fs03 clTxt2">'."\n";
$code .= '</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Cook Time</th>'."\n";
$code .= '<td>'."\n";
$code .= '<input type="text" name="cooktime[]" placeholder="ex: 30 minutes" class="clBg5 clBd2 fs03 clTxt2">'."\n";
$code .= '</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Serving (People)</th>'."\n";
$code .= '<td>'."\n";
$code .= '<input type="text" name="serving[]" class="clBg5 clBd2 fs03 clTxt2">'."\n";
$code .= '</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Calorie (cal)</th>'."\n";
$code .= '<td>'."\n";
$code .= '<input type="text" name="calorie[]" class="clBg5 clBd2 fs03 clTxt2">'."\n";
$code .= '</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Difficulty</th>'."\n";
$code .= '<td>'."\n";
$code .= '<div class="listName clearfix">'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="difficulty[]" value="1" checked=""  >'."\n";
$code .= '<label for="dif1">Easy</label>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="difficulty[]" value="2"  >'."\n";
$code .= '<label for="dif2">Medium</label>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="difficulty[]" value="3"  >'."\n";
$code .= '<label for="dif3">Hard</label>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="difficulty[]" value="4" >'."\n";
$code .= '<label for="dif4">Advanced</label>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="difficulty[]" value="5" >'."\n";
$code .= '<label for="dif5">Expert</label>'."\n";
$code .= '</div>'."\n";
$code .= '</div>'."\n";
$code .= '</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Cost</th>'."\n";
$code .= '<td>'."\n";
$code .= '<div class="listName clearfix">'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="cost[]" value="1" checked="" >'."\n";
$code .= '<label for="cost1">Low</label>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="cost[]" value="2" >'."\n";
$code .= '<label for="cost2">Medium-Low</label>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="cost[]" value="3">'."\n";
$code .= '<label for="cost3">Medium</label>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="cost[]" value="4">'."\n";
$code .= '<label for="cost4">Medium-High</label>'."\n";
$code .= '</div>'."\n";
$code .= '<div class="lstCook">'."\n";
$code .= '<input type="radio" name="cost[]" value="5">'."\n";
$code .= '<label for="cost5">High</label>'."\n";
$code .= '</div>'."\n";
$code .= '</div>'."\n";
$code .= '</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Type</th>'."\n";
$code .= '<td>'."\n";
$code .= '<div class="listName">'."\n";
$code .= '<input type="radio" checked="" value="1" name="type[]">'."\n";
$code .= '<label for="free">Free</label>'."\n";
$code .= '<input type="radio" value="2" name="type[]">'."\n";
$code .= '<label for="subSc">Subscribe</label>'."\n";
$code .= '</div>'."\n";
$code .= '</td>'."\n";
$code .= '</tr>'."\n";
$code .= '</tbody></table>'."\n";
$code .= '</fieldset>'."\n";
$code .= '</form>'."\n";
$code .= '</div>';

  $arraydata['form']=addslashes(str_replace(array("\r", "", "\r"), '', $code));
 // $arraydata['js'][]=pluginjsinfo.'/upload.js';


  
  
      
  
  
  
  return $arraydata;
  
  
  
  
  
  
  
  }
  
  function getformlanding($arraydata)
  {
    $code  = '<div class="ldIt wrpFrmLd wrpCookLd clBg4">'."\n";
$code .= '<div class="wrpHdInfoGen mgBtm10">'."\n";
$code .= '<h2 class="clTxt2 fs04 boldGen">Cuisine Data</h2>'."\n";
$code .= '</div>'."\n";
$code .= '<table class="tbGenInfo tbFrmLd clTxt3 fs03">'."\n";
$code .= '<tbody><tr>'."\n";
$code .= '<th>Prep Time</th>'."\n";
$code .= '<td>'.$arraydata['preptime'].'</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Cook Time</th>'."\n";
$code .= '<td>'.$arraydata['cooktime'].'</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Serving</th>'."\n";
$code .= '<td>'.$arraydata['serving'].'</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Calorie</th>'."\n";
$code .= '<td>'.$arraydata['calorie'].'</td>'."\n";
$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Difficulty</th>'."\n";
            $difficulty='Expert';
            switch ($arraydata['difficulty']) {
                case '1':
                $difficulty='Easy';
                break;
                case '2':
                $difficulty='Medium';
                break;
                case '3':
                $difficulty='Hard';
                break;
                case '4':
                $difficulty='Advanced';
                break;
            }

$code .= '<td>'.$difficulty.'</td>'."\n";



$code .= '</tr>'."\n";
$code .= '<tr>'."\n";
$code .= '<th>Cost</th>'."\n";


$difficulty='High';
            switch ($arraydata['difficulty']) {
                case '1':
                $difficulty='Low';
                break;
                case '2':
                $difficulty='Medium-Low';
                break;
                case '3':
                $difficulty='Medium';
                break;
                case '4':
                $difficulty='Medium-High';
                break;
            }

$code .= '<td>'.$difficulty.'</td>'."\n";
$code .= '</tr>'."\n";



$code .= '<tr>'."\n";
$code .= '<th>Type</th>'."\n";


$difficulty='Free';
            switch ($arraydata['type']) {
                case '2':
                $difficulty='Subscribe';
                break;


            }

$code .= '<td>'.$difficulty.'</td>'."\n";
$code .= '</tr>'."\n";


$code .= '</tbody></table>'."\n";
$code .= '</div>';


    $data['str']=$code;
    $data['target']='secondtarget';

    return $data;
  
  
  }
  
  function getplugin($plugreid)
  {
  
  $sql="select * from tb_plugins_cuisinedata where plugreid=".$plugreid;
  $arrayplugin=$this->db->db_set_1recordrow($sql);


$arrayplugin['difficulty']=intval($arrayplugin['difficulty']);
$arrayplugin['cost']=intval($arrayplugin['cost']);
  
  
  return $arrayplugin;
  

  
  
  

  
  }
  
  function saveplugin($arraydata,$productid,$plugreid)
  {
  $arraydata['productid']=$productid;
  $arraydata['plugreid']=$plugreid;

  $this->db->db_set($arraydata,'tb_plugins_cuisinedata');
  
  }
  
  
  }
?>
